package com.example.g32.notice

import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.entity.NoticeEntityItem
import com.example.g32.R
import com.example.g32.databinding.ItemNoticeBinding

class NoticeAdapter: BaseQuickAdapter<NoticeEntityItem, BaseViewHolder>(R.layout.item_notice) {
    override fun onItemViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
        super.onItemViewHolderCreated(viewHolder, viewType)
        DataBindingUtil.bind<ItemNoticeBinding>(viewHolder.itemView)
    }

    override fun convert(helper: BaseViewHolder, item: NoticeEntityItem) {
        val binding = DataBindingUtil.getBinding<ItemNoticeBinding>(helper.itemView)!!
        binding.bean = item
    }
}